package me.learn.javaweb.controller;

import me.learn.javaweb.pojo.Company;
import me.learn.javaweb.pojo.Response;
import me.learn.javaweb.service.ICompanyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/test")
public class TestController {
    @Autowired
    private ICompanyService companyService;
    @GetMapping("/")
    public String test() {
        return "请求成功";
    }

    @GetMapping("/company")
    public Response<Company> getCompany(String name){
        return Response.success(companyService.getCompany(name));
    }
}
